<section id="behavior">
    {% if results.behavior.summary %}
        <div class="section-title">
            <h4>Behavior Summary</h4>
        </div>
        <div class="well well-small">
            <b>Files</b>
            {% if results.behavior.summary.files %}
                <ul>
                    {% for file in results.behavior.summary.files %}
                    <li><span class="mono">{{file}}</span></li>
                    {% endfor %}
                </ul>
            {% else %}
                Nothing to display.
            {% endif %}
        </div>
        <div class="well well-small">
            <b>Mutexes</b>
            {% if results.behavior.summary.mutexes %}
                <ul>
                    {% for mutex in results.behavior.summary.mutexes %}
                    <li><span class="mono">{{mutex}}</span></li>
                    {% endfor %}
                </ul>
            {% else %}
                Nothing to display.
            {% endif %}
        </div>
        <div class="well well-small">
            <b>Registry Keys</b>
            {% if results.behavior.summary["keys"] %}
                <ul>
                    {% for key in results.behavior.summary["keys"] %}
                    <li><span class="mono">{{key}}</span></li>
                    {% endfor %}
                </ul>
            {% else %}
                Nothing to display.
            {% endif %}
        </div>
    {% endif %}

    <div class="section-title">
        <h4>Processes</h4>
    </div>
    {% if results.behavior.processes %}
        {% for process in results.behavior.processes %}
        <div>
            <h4><a href="javascript:showHide('process_{{process.process_id}}');">{{process.process_name}}</a> <small>PID: {{process.process_id}}, Parent PID: {{process.parent_id}}</small></h4>
            <div id="process_{{process.process_id}}" style="display: none;">
                <table class="table table-striped table-bordered table-condensed" style="width: 100%; word-wrap:break-word;table-layout: fixed;">
                    <tr>
                        <th>Timestamp</th>
                        <th>Thread</th>
                        <th>Function</th>
                        <th>Arguments</th>
                        <th>Status</th>
                        <th>Return</th>
                        <th>Repeated</th>
                    </tr>
                    {% for call in process.calls %}
                    <tr>
                        <td>{{call.timestamp[11:]}}</td>
                        <td>{{call.thread_id}}</td>
                        <td><span class="mono">{{call.api}}</span></td>
                        <td style="word-wrap: break-word">
                        {% for argument in call.arguments %}
                            {{argument.name}} => <span class="mono">{{argument.value}}</span><br />
                        {% endfor %}
                        </td>
                        <td>{{call.status}}</td>
                        <td>{{call.return}}</td>
                        <td>
                        {% if call.repeated and call.repeated > 0 %}
                            {{call.repeated}}
                            {% if call.repeated == 1 %}
                             time
                            {% elif call.repeated > 1 %}
                             times
                            {% endif %}
                        {% endif %}
                        </td>
                    </tr>
                    {% endfor %}
                </table>
            </div>
        </div>
        {% endfor %}
    {% else %}
        Nothing to display.
    {% endif %}
</section>
